<%-- 
    Document   : pay01010
    Created on : Nov 17, 2012, 11:10:22 PM
    Author     : HoangTN
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Select payroll</title>
    </head>
    <body>
        <h1>Select payroll</h1>
        <form action="SearchPayrollController" method="POST">
            <table cellpadding="3">
                <tbody>
                    <tr>
                        <td>From Date</td>
                        <td>
                            <input type="text" size="3" name="fromYear"> /
                            <input type="text" size="3" name="fromMonth"> /
                            <input type="text" size="3" name="fromDay">
                        </td>
                        <td>(yyyy/MM/dd)</td>
                    </tr>
                    <tr>
                        <td>To Date</td>
                        <td>
                            <input type="text" size="3" name="toYear"> /
                            <input type="text" size="3" name="toMonth"> /
                            <input type="text" size="3" name="toDay">
                        </td>
                        <td>(yyyy/MM/dd)</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td align="center">
                            <input type="submit" name="action" value="View" />
                        </td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
        </form>

        <c:set var="result" value="${sessionScope.result}" />
        <c:if test="${not empty result}" >
            <h1 font="12">Search result</h1>
            <table border="1">
                <thead>
                <th>ID</th>
                <th>Employee</th>
                <th>Payroll Date</th>
                <th>Amount</th>
                <th>Type</th>
            </thead>
            <c:forEach var="info" items="${result}" varStatus="counter" >
                <tbody>
                <th>${counter.count}</th>
                <th>${info.employeeID}</th>
                <th>${info.payrollDate}</th>
                <th>${info.amount}</th>
                <th>${info.payrollType}</th>
            </tbody>
        </c:forEach>
    </c:if>
</table>
</body>
</html>
